<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
    </ul>
    <script>
        // 初始化
        function doInit() {
            let arr = [];
            for (let i = 1;i <= 100;i ++) {
                arr.push(i);
            }

            let newArr = [];
            for (let i = 0;i < 100;i ++) {
                let index = Math.floor(Math.random() * arr.length);
                newArr.push(arr.splice(index,1)[0]);
            }
            return newArr;
        }

        let arr = doInit();
        console.log(arr);
        

    </script>


</body>
</html>